package com.foxit.adapp;
import java.util.ArrayList;

public class GroupSet {   

     private ArrayList<GroupUnit> gu;

     public GroupSet() {
     }
     public GroupSet(String gs) {
           if(gs!=null && gs.length()!=0) {
              String[] g=gs.split(";");
              ArrayList<GroupUnit> u=new ArrayList<GroupUnit>();
              if(g.length>=1) {
                  for(int i=0; i < g.length;i++) {
                       String[] t = g[i].split(",");
                       GroupUnit a= new GroupUnit(t[0],t[1],t[2],t[3],t[4]);
                       u.add(a);
                  }
              }
              this.gu = u;
           }
     }
     public String[] getAD(String name, int v) { 
           int s = gu.size();
           for(int i=0;i < s;i++) {
               if(gu.get(i).getName().equals(name)) {
                   String[] a= new String[2];
                   a[0] = gu.get(i).getAD(v);
                   a[1] = gu.get(i).getDimension();
                   return a;
               }
           } 
           return null; 
     }

}
